<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            border: 1px solid black;
            margin: 10px;
            padding: 4px;
        }
    </style>
</head>
<body>
    <div id="app">
        <p>msg:{{msg}}</p>
        <p>info:{{info}}</p>
        <my-comp v-model="msg" v-model:info="info"></my-comp>
        
    </div>
    <script type="text/x-template" id="mycomp">
        <div class="box">
            <input type="text" v-model="argA"><br>
            <input type="text" v-model=argB>
        </div>
    </script>
    <script type="module">
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        const MyComp={
            template:'#mycomp',
            props:["modelValue","info"],
            // emits:["update:modelValue","update:info"],
            computed:{
                argA:{
                    get(){
                        return this.modelValue
                    },
                    set(nv){
                        this.$emit("update:modelValue",nv)
                    }
                },
                argB:{
                    get(){
                        return this.info
                    },
                    set(nv){
                        this.$emit("update:info",nv)
                    }
                }
            }
        }
        createApp({
            data() {
                return {
                    msg:'msg变量',
                    info:'info变量'
                }
            },
            components:{
               MyComp 
            }
        }).mount("#app");
    </script>
</body>
</html>